Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing okhttp testing deobfuscation #180

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

LikeTheSalad
Copy link
Contributor

I wanted to include R8/ProGuard verifications to the okhttp instrumentation test, however, R8/ProGuard doesn't seem to work well when corelib desugaring is enabled, so I've deleted the R8/ProGuard verification in this PR to address this issue.

@LikeTheSalad LikeTheSalad requested a review from a team December 11, 2023 11:24
android {
buildTypes {
debug {
isMinifyEnabled = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be wrong but I guess isMinifyEnabled is NoOp for debug builds, not sure if this has something to do with the problem you've faced.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if that's the reason because it seems to work well when the desugaring is disabled 🤔 The problem I saw with desugaring enabled is that it seems like the corelib classes are trimmed by R8, even though I add rules to keep them... Specifically, the test crashed because the function Duration.toMillis wasn't found, and the error was mentioning the class like so: Lj$/time/Duration;. I'm guessing j$ is the shade name given by Google's desugaring to the corelib classes.

Based on that, I tried to avoid it by adding these rules:

-keep class java.time.** { *; }
-keep class j$.time.** { *; }

But no luck, they seem to be ignored.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was done on API 33.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@marandaneto marandaneto Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm, thats what this PR does and the java.time requires desugaring so I guess its the right solution.

@breedx-splk breedx-splk merged commit a38ef4f into open-telemetry:main Dec 11, 2023
2 checks passed
@LikeTheSalad LikeTheSalad deleted the fix-compilation branch December 12, 2023 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants